package week2.day10;

/**
 * @Author fengzihao
 * @Date 2024-04-24 13:54
 */
public class FinalTest {

}

class Final {
    // 静态成员变量显式直接赋值
    public static final int staticA = 100;
    // 静态代码块赋值
    public static final int staticB;

    static {
        staticB = 200;
    }

    // 第一种，显式直接赋值
    public final int a = 10;
    // 第二种，构造代码块赋值
    public final int b;
    // 构造器赋值
    public final int c;

    {
        b = 20;
    }

    public Final(int c) {
        this.c = c;
    }
}
